package com.test.smartcampusapi.service;

import com.test.smartcampusapi.entity.User;
import com.test.smartcampusapi.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Date : 4/22/2022 9:54 PM
 * Author : lingy
 * Description : ...
 */
@Service
public class UserService implements UserMapper {
    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> getAllUsers() {
        return userMapper.getAllUsers();
    }

    @Override
    public int addUser(String account, String password) {
        return userMapper.addUser(account, password);
    }

    @Override
    public int login(String account, String password) {
        return userMapper.login(account, password);
    }

    @Override
    public int updateInformation(String userAccount, String userGender, String userDescription, String userPhone) {
        return userMapper.updateInformation(userAccount, userGender, userDescription, userPhone);
    }

    @Override
    public int bindCard(String userAccount, String cardNumber) {
        return userMapper.bindCard(userAccount, cardNumber);
    }

    @Override
    public int unBindCard(String userAccount) {
        return userMapper.unBindCard(userAccount);
    }

    @Override
    public User getUserInfo(String userAccount) {
        return userMapper.getUserInfo(userAccount);
    }


}
